
from tortoise.models import Model
from tortoise import fields

class Book(Model):
    id = fields.BigIntField(pk=True, generated=True)
    parent_id = fields.BigIntField()
    repository_id = fields.BigIntField()
    user_id = fields.BigIntField()
    type = fields.CharField(max_length=32)
    title = fields.CharField(default='新创建文档', max_length=64)
    content = fields.TextField(default='')
    short_uri = fields.CharField(max_length=64)
    sort_order = fields.IntField(default=0)
    create_time = fields.DatetimeField(auto_now_add=True, null=True)
    update_time = fields.DatetimeField(auto_now=True, null=True)
    del_flag = fields.BooleanField(default=False, null=True)

    class Meta:
        table = 't_book'
